# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Discovery.V1.Model.RestMethod do
  @moduledoc """


  ## Attributes

  *   `apiVersion` (*type:* `String.t`, *default:* `nil`) - The API Version of this method, as passed in via the `X-Goog-Api-Version` header or `$apiVersion` query parameter.
  *   `deprecated` (*type:* `boolean()`, *default:* `nil`) - Whether this method is deprecated.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Description of this method.
  *   `etagRequired` (*type:* `boolean()`, *default:* `nil`) - Whether this method requires an ETag to be specified. The ETag is sent as an HTTP If-Match or If-None-Match header.
  *   `flatPath` (*type:* `String.t`, *default:* `nil`) - The URI path of this REST method in (RFC 6570) format without level 2 features ({+var}). Supplementary to the path property.
  *   `httpMethod` (*type:* `String.t`, *default:* `nil`) - HTTP method used by this method.
  *   `id` (*type:* `String.t`, *default:* `nil`) - A unique ID for this method. This property can be used to match methods between different versions of Discovery.
  *   `mediaUpload` (*type:* `GoogleApi.Discovery.V1.Model.RestMethodMediaUpload.t`, *default:* `nil`) - Media upload parameters.
  *   `parameterOrder` (*type:* `list(String.t)`, *default:* `nil`) - Ordered list of required parameters, serves as a hint to clients on how to structure their method signatures. The array is ordered such that the "most-significant" parameter appears first.
  *   `parameters` (*type:* `%{optional(String.t) => GoogleApi.Discovery.V1.Model.JsonSchema.t}`, *default:* `nil`) - Details for all parameters in this method.
  *   `path` (*type:* `String.t`, *default:* `nil`) - The URI path of this REST method. Should be used in conjunction with the basePath property at the api-level.
  *   `request` (*type:* `GoogleApi.Discovery.V1.Model.RestMethodRequest.t`, *default:* `nil`) - The schema for the request.
  *   `response` (*type:* `GoogleApi.Discovery.V1.Model.RestMethodResponse.t`, *default:* `nil`) - The schema for the response.
  *   `scopes` (*type:* `list(String.t)`, *default:* `nil`) - OAuth 2.0 scopes applicable to this method.
  *   `supportsMediaDownload` (*type:* `boolean()`, *default:* `nil`) - Whether this method supports media downloads.
  *   `supportsMediaUpload` (*type:* `boolean()`, *default:* `nil`) - Whether this method supports media uploads.
  *   `supportsSubscription` (*type:* `boolean()`, *default:* `nil`) - Whether this method supports subscriptions.
  *   `useMediaDownloadService` (*type:* `boolean()`, *default:* `nil`) - Indicates that downloads from this method should use the download service URL (i.e. "/download"). Only applies if the method supports media download.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :apiVersion => String.t() | nil,
          :deprecated => boolean() | nil,
          :description => String.t() | nil,
          :etagRequired => boolean() | nil,
          :flatPath => String.t() | nil,
          :httpMethod => String.t() | nil,
          :id => String.t() | nil,
          :mediaUpload => GoogleApi.Discovery.V1.Model.RestMethodMediaUpload.t() | nil,
          :parameterOrder => list(String.t()) | nil,
          :parameters =>
            %{optional(String.t()) => GoogleApi.Discovery.V1.Model.JsonSchema.t()} | nil,
          :path => String.t() | nil,
          :request => GoogleApi.Discovery.V1.Model.RestMethodRequest.t() | nil,
          :response => GoogleApi.Discovery.V1.Model.RestMethodResponse.t() | nil,
          :scopes => list(String.t()) | nil,
          :supportsMediaDownload => boolean() | nil,
          :supportsMediaUpload => boolean() | nil,
          :supportsSubscription => boolean() | nil,
          :useMediaDownloadService => boolean() | nil
        }

  field(:apiVersion)
  field(:deprecated)
  field(:description)
  field(:etagRequired)
  field(:flatPath)
  field(:httpMethod)
  field(:id)
  field(:mediaUpload, as: GoogleApi.Discovery.V1.Model.RestMethodMediaUpload)
  field(:parameterOrder, type: :list)
  field(:parameters, as: GoogleApi.Discovery.V1.Model.JsonSchema, type: :map)
  field(:path)
  field(:request, as: GoogleApi.Discovery.V1.Model.RestMethodRequest)
  field(:response, as: GoogleApi.Discovery.V1.Model.RestMethodResponse)
  field(:scopes, type: :list)
  field(:supportsMediaDownload)
  field(:supportsMediaUpload)
  field(:supportsSubscription)
  field(:useMediaDownloadService)
end

defimpl Poison.Decoder, for: GoogleApi.Discovery.V1.Model.RestMethod do
  def decode(value, options) do
    GoogleApi.Discovery.V1.Model.RestMethod.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Discovery.V1.Model.RestMethod do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
